package com.agileboot.medicine.controller.system;

import com.agileboot.common.core.dto.ResponseDTO;
import com.agileboot.domain.medicine.vo.MedicineInfoVO;
import com.agileboot.domain.news.db.NewsInfoService;
import com.agileboot.domain.news.vo.NewsInfoVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/news")
public class NewsController {
    /**
     * 新闻资讯
     */
    @Resource
    private NewsInfoService newsInfoService;

    /**
     * 首页推荐模块
     */
    @Operation(summary = "首页推荐草药模块")
    @GetMapping("/list")
    public ResponseDTO<List<NewsInfoVO>> getNewsList() throws IOException {
        List<NewsInfoVO> newsInfoVOS = newsInfoService.getNewsList();
        return ResponseDTO.ok(newsInfoVOS);
    }
}
